<?php
	/* CHECK IF THE SITE EXISTS AND IT'S ACTIVE */
	function set_connection($ajax = false)
	{
		global $connection;
		
		$params['hostname']=DB_SERVER;
		$params['dbname']= DB_NAME;
		$params['username']= DB_USERNAME;
		$params['password']= DB_PASS;
		
		$connection = new mysqlClass($params);
		
		return $connection;
	}
	
	function get_domain($url)
	{
		$parsedUrl = parse_url($url);
		$host = explode('.', $parsedUrl['host']);
		$subdomain = $host[0];
		return $host[0];
	}
	
	function destroyConnection()
	{
		global $connection;
		
		$connection->__destruct();
	}
?>